import Vue from 'vue'
import VueRouter from 'vue-router'
import discover from '../views/Discover.vue'
import mymusic from '../views/MyMusic'
import tuijian from '../views/Disc_tuijian.vue'
import seachPage from '../views/Seach_page.vue'
Vue.use(VueRouter)
    //所有路由规则
const routes = [
    { path: '/', redirect: 'discover', component: discover }, {
        name: 'discover',
        path: '/discover',
        redirect: '/discover/tuijian',
        component: discover,
        children: [{
            name: 'tuijian',
            path: '/discover/tuijian',
            component: tuijian
        }, {
            name: 'toplist',
            path: '/discover/toplist',
            component: () =>
                import ('../views/Disc_toplist')
        }, {
            name: 'playlist',
            path: '/discover/playlist/cat=:tit',
            component: () =>
                import ('../views/Disc_playlist'),
            props: true
        }, {
            name: 'artist',
            path: '/discover/artist',
            component: () =>
                import ('../views/Disc_artist')
        }, {
            name: 'album',
            path: '/discover/album',
            component: () =>
                import ('../views/Disc_album')
        }, {
            name: 'seachPage',
            path: '/discover/seachPage',
            component: seachPage
        }, {
            name: 'musicInfo',
            path: '/discover/musicInfo/id=:id',
            component: () =>
                import ('../views/musicInfo'),
            props: true
        }, {
            name: 'playlistInfo',
            path: '/discover/playlistInfo/id=:id',
            component: () =>
                import ('../views/playlistInfo'),
            props: true
        }, {
            name: 'songerInfo',
            path: '/discover/songerInfo/id=:id',
            component: () =>
                import ('../views/songerInfo'),
            props: true
        }, {
            name: 'albumInfo',
            path: '/discover/albumInfo/id=:id',
            component: () =>
                import ('../views/albumInfo'),
            props: true
        }]
    },
    { name: 'mymusic', path: '/mymusic', component: mymusic },
    { name: 'seachPage', path: '/seachPage', component: seachPage }
]

const router = new VueRouter({
    routes
})

export default router